#include <stdio.h>
#include <stdlib.h>

void stringLols(char pc[]){

int i=sizeof(*pc)/sizeof(char);
char s[i];
int c=0;
while(c<i){
    s[c]=pc[c];
    c++;
}
int j=0;
int y=i-2;
while(j<i){
    pc[j]=s[y];
    j++;
    y--;
}

}

int main()
{
puts("Enter string\n");
char *pstr= (char*)malloc(2);
pstr[0]=' ';
char c;
c= getchar();
int sizes=0;

while(c!='\n'){
    pstr=(char *)realloc(pstr, sizes+2*sizeof(char));

    pstr[sizes]=c;
    c=getchar();
    sizes++;
}
printf("%s", pstr);
free(pstr);

return 0;
}
